﻿@model IEntityViewModel<Forum>
@{
    ViewData["Title"] = "主页";
    int count = 0;
}
@foreach (var board in Model.Items.GroupBy(t => t.Board))
{
    <div class="page-header">
        <h1>@board.Key.Name<small> @board.Key.Description</small></h1>
    </div>
    @foreach (var item in board)
    {
        if (count % 2 == 0)
        {
            @Html.Raw("<div class=\"media\">")
        }
        <div class="media-left">
            <a href="@Html.Raw(Url.Action("Index", "Forum", new { id = item.Index }))">
                <img class="media-object" src="" alt="..." />
            </a>
        </div>
        <div class="media-body">
            <h4 class="media-heading"><a href="@Html.Raw(Url.Action("Index", "Forum", new { id = item.Index }))">@item.Name</a></h4>
            @item.Description
        </div>
        if (count % 2 == 1)
        {
            @Html.Raw("</div>")
        }
        count++;
    }
    @if (count % 2 == 0)
    {
        @Html.Raw("</div>")
    }
}